package com.jiayang.hhotel.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.TextView;

import com.jiayang.hhotel.R;
import com.jiayang.hhotel.presenter.ContactPersonAddedPresenter;

import cn.droidlover.xdroidmvp.mvp.XActivity;

/**
 * Created by Administrator on 2017/5/26 0026.
 * 联系人新增页面
 */

public class ContactPersonAddedActivity extends XActivity<ContactPersonAddedPresenter> implements View.OnClickListener, CompoundButton.OnCheckedChangeListener {

    private EditText name,//姓名
                    phoneNum;//手机号
    private TextView departmentSelect;//选择部门
    private RadioButton can,can_t;//能使用协议价/不能使用协议价
    private Button save;//保存按钮

    @Override
    public void initData(Bundle savedInstanceState) {
        name= (EditText) findViewById(R.id.et_name);
        phoneNum= (EditText) findViewById(R.id.et_phone_num);
        departmentSelect= (TextView) findViewById(R.id.bt_department_select);
        can= (RadioButton) findViewById(R.id.rb_can);
        can_t= (RadioButton) findViewById(R.id.rb_can_t);
        save= (Button) findViewById(R.id.bt_save);

        departmentSelect.setOnClickListener(this);
        save.setOnClickListener(this);
        can.setOnCheckedChangeListener(this);
        can_t.setOnCheckedChangeListener(this);
    }

    @Override
    public int getLayoutId() {
        return R.layout.layout_contact_person_added;
    }

    @Override
    public ContactPersonAddedPresenter newP() {
        return new ContactPersonAddedPresenter();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.bt_department_select://选择部门
                break;
            case R.id.bt_save://保存
                break;
        }
    }

    @Override
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
        switch (buttonView.getId()){
            case R.id.rb_can://可以使用
                if(isChecked){

                }
                break;
            case R.id.rb_can_t://不能使用
                if(isChecked){

                }
                break;
        }
    }
}
